/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.edu.utfpr.provider;

import br.com.caelum.vraptor.ComponentRegistry;
import br.com.caelum.vraptor.ioc.spring.SpringProvider;
import br.com.caelum.vraptor.util.jpa.EntityManagerCreator;
import br.com.caelum.vraptor.util.jpa.EntityManagerFactoryCreator;
import br.com.caelum.vraptor.util.jpa.JPATransactionInterceptor;

/**
 *
 * @author guardezi
 */
public class VraptoProvider extends SpringProvider{

    @Override
    protected void registerCustomComponents(ComponentRegistry registry) {
        registry.register(EntityManagerCreator.class, EntityManagerCreator.class); // cria EntityManager's
        registry.register(EntityManagerFactoryCreator.class, EntityManagerFactoryCreator.class); //cria uma EntityManagerFactory
        registry.register(JPATransactionInterceptor.class, JPATransactionInterceptor.class); //open EntityManager and transaction in view
    }
    
    
}
